package com.sitech.ibnms.util.servlet;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.springframework.web.context.support.WebApplicationContextUtils;

import com.sitech.context.SpringContext;
import com.sitech.util.spring.WebApplicationContext;

public class InitServlet extends HttpServlet {


	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public void init() throws ServletException {
		    super.init();	
			//TaskJobManager taskJobManager=new TaskJobManager();		
			//taskJobManager.exec();
		    ServletContext sc=this.getServletContext();
		    WebApplicationContext context= (WebApplicationContext) WebApplicationContextUtils.getWebApplicationContext(sc);
		    SpringContext.setBeanFactory(context);
		    try {
//				SpringContext.getBean("execInstrNodeAction");
//				System.out.println("加载了bean");
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			//TaskJobManager taskJobManager=new TaskJobManager();		
			//taskJobManager.exec();
		
		
	}
	
}
